<?php
$this->breadcrumbs=array(
	'综合控制台'=>array($this->pre_module_url.'/index/index'),
	'产品管理'=>array($this->pre_module_url.'/productSale/admin'),
	'分类属性管理'=>array($this->pre_module_url.'/attribute/selectcategory'),
);
?>
<div class="manage_box pro_attribute">
	<div class="remind_box ff_s c_f mt10">
		<a title="" href="/manage/attribute/selectcategory" class="c_06c f_r mr10">重新选择分类</a>
		<span>您当前选择的类目：<strong class="c_f60"><?php if($category->zca_level==3){ ?>
		<?php echo CHtml::encode(Category::model()->getTitle($category->zca_topid))?> &gt; 
		<?php }?>
		<?php echo CHtml::encode(Category::model()->getTitle($category->zca_parentid))?> &gt;
		<?php echo CHtml::encode($category->zca_title)?>
		</strong></span>
	</div>
    <div class="hr_12"></div>
	<div class="addtype_tab bd_db">
    	<div class="hd mem_bgx"><h2>属性管理</h2></div>
        <div class="hd bgcolor">
            <ul class="c_f">
                <li class="w_180 t_l">属性名称</li>
                <li class="b">属性值</li>
                <li class="c">排序</li>
                <li class="w_60">搜索支持</li>				
				<li class="w_60">属性类型</li>
                <li class="e">操作</li>
            </ul>
        </div>
        <div class="bd" id="addAttribute">
            <?php $form=$this->beginWidget('CActiveForm', array(
			'action'=>$this->pre_module_url.'/attribute/update',
			'method'=>'post',
			)); ?>
                <div class="type_list">
                    <ul class="main_class">
                    	<?php $this->widget('zii.widgets.CListView', array(
							'dataProvider'=>Attribute::model()->loadAttByCateId($category->zca_id),
							'template'=>'{items}',
							'itemView'=>'_view',
							'id'=>'att',
						)); ?>
                    </ul>
                </div>
                <div class="add_type"><a class="mem_bgx link_btn click mr10 f_l" href="javascript:" title="" onclick="$('#addAttribute .add_form').show()">添加新属性<b class="mem_bgx left"></b><b class="mem_bgx right"></b></a><input class="mem_btn mem_btn13" type="submit" value="保存" name=""></div>
            <?php $this->endWidget(); ?>
            <!-- 添加产品规格属性 start-->
            <div class="add_type add_form hide">                
                    <ul class="list">
						<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>                        
                	</ul>
             </div>
           <!-- 添加产品规格属性 end-->
        </div>
    </div>
    <div class="hr_12"></div>
	<div class="addtype_tab bd_db">
    	<div class="hd mem_bgx"><h2>规格管理</h2></div>
        <div class="hd bgcolor">
            <ul class="c_f">
                <li class="a">规格名称</li>
                <li class="b">规格值</li>
                <li class="c">排序</li>
                <li class="d">图片支持</li>
                <li class="e">操作</li>
            </ul>
        </div>
        <div class="bd" id="addSize">
            <?php $form=$this->beginWidget('CActiveForm', array(
				'action'=>$this->pre_module_url.'/attribute/update',
				'method'=>'post',
			)); ?>
                <div class="type_list">
                    <ul class="main_class">
                        <?php $this->widget('zii.widgets.CListView', array(
							'dataProvider'=>Attribute::model()->loadStaByCateId($category->zca_id),
                        	'template'=>'{items}',
							'itemView'=>'_speview',
							'summaryText'=>'',
						)); ?>
                    </ul>
                </div>
                <div class="add_type"><a class="mem_bgx link_btn click mr10 f_l" href="javascript:" onclick="$('#addSize .add_form').show()" title="添加新规格">添加新规格<b class="mem_bgx left"></b><b class="mem_bgx right"></b></a><input class="mem_btn mem_btn13" type="submit" value="保存" name=""></div>
            <?php $this->endWidget(); ?>
            <div class="add_type add_form hide">                
                    <ul class="list">
                    	<?php echo $this->renderPartial('_speform', array('model'=>$model)); ?>                  
                    </ul>
             </div>
        </div>
    </div>
</div>

<script type="text/javascript" src="/js/jquery-ui-1.9.2.custom.js"></script>
<script type="text/javascript">
$(function(){	
    //移动排序下移
    $('.downlist').live('click',function(){
        var a = $(this).parent().parent().parent().parent();
		a.next('li').after(a);
    });
    //移动排序上移
    $('.uplist').live('click',function(){
        var a = $(this).parent().parent().parent().parent();
		a.prev('li').before(a);
    }); 
});
</script>